cmake_minimum_required(VERSION 3.17)

project(Test1_TC397)

set(BasePath  ${CMAKE_CURRENT_SOURCE_DIR})
set(LinkerPath "D:/TASKING/ctc/include.lsl")

add_compile_options(
-Ctc39xb
--create=object
--lsl-core=vtc
-t
-Wa-Hsfr/regtc39xb.def
-Wa-gAHLs
--emit-locals=-equs,-symbols
-Wa-Ogs
-Wa--error-limit=42
-Hsfr/regtc39xb.sfr
--iso=11
--language=-gcc,-volatile,+strings,-kanji
--fp-model=3
--switch=auto
--align=0
--default-near-size=8
--default-a0-size=0
--default-a1-size=0
-O2
--tradeoff=4
--compact-max-size=200
-g
--error-limit=42
--source
)

add_link_options(
-D__CPU__=tc39xb 
-D__CPU_TC39XB__
-D__PROC_TC39XB__
-lcs_fpu 
-lfp_fpu 
-lrt
--core=mpe:vtc 
-OtxycL 
--map-file=${CMAKE_PROJECT_NAME}.map
-mcrfiklSmNOduQ 
--error-limit=42
-I${BasePath}
-d${BasePath}/Test1.lsl
)

file(GLOB CommonFiles 
${BasePath}/cstart_tc1.c
${BasePath}/cstart_tc2.c
${BasePath}/cstart_tc3.c
${BasePath}/cstart_tc4.c
${BasePath}/cstart_tc5.c
${BasePath}/cstart.c
${BasePath}/sync_on_halt.c
${BasePath}/Test1.c
)

include_directories( PRIVATE
${BasePath}
)

add_executable(${CMAKE_PROJECT_NAME}  ${CommonFiles} )